<?php

namespace app\controller\admin;

use core\controller\AdminBase;
use core\lib\schema\Table;
use support\Db;
use support\View;

class Workflow extends AdminBase
{
    public  function design()
    {
        $tables = request()->get('tables');
        $tables_det = [];
        if ($tables) {
            $tables_arr = explode(',', $tables);
            foreach ($tables_arr as $key => $table) {
                $tableSchema = new Table($table);
                $tables_det[] = [
                    'name'    => $table,
                    'comment' => $tableSchema->getTableComment(),
                    'columns' => $tableSchema->getColumns()
                ];
            }
        }
        dump($tables_det);
        View::assign('tables_det', $tables_det);
        return view('admin/Workflow/design');
    }
}
